package xuegao.study.mall.admin.feign;

import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import xuegao.study.mall.common.api.CommonPage;
import xuegao.study.mall.common.api.CommonResult;
import xuegao.study.mall.common.model.oms.OmsOrderReturnReason;

import java.util.List;

@FeignClient(contextId = "return-reason", name = "study-order-service", path = "/oms/returnReason")
public interface OmsOrderReturnReasonClient {

    @ApiOperation("添加退货原因")
    @PostMapping(value = "/create")
    CommonResult create(@RequestBody OmsOrderReturnReason returnReason);

    @ApiOperation("修改退货原因")
    @PostMapping(value = "/update/{id}")
    CommonResult update(@PathVariable Long id, @RequestBody OmsOrderReturnReason returnReason);

    @ApiOperation("批量删除退货原因")
    @PostMapping(value = "/delete")
    CommonResult delete(@RequestParam("ids") List<Long> ids);

    @ApiOperation("分页查询退货原因")
    @GetMapping(value = "/list")
    CommonResult<CommonPage<OmsOrderReturnReason>> list(@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
                                                        @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum);

    @ApiOperation("获取单个退货原因详情")
    @GetMapping(value = "/{id}")
    CommonResult<OmsOrderReturnReason> getItem(@PathVariable Long id);

    @ApiOperation("修改退货原因启动状态")
    @PostMapping(value = "/update/status")
    CommonResult updateStatus(@RequestParam(value = "status") Integer status,
                              @RequestParam("ids") List<Long> ids);
}
